Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply input transformation to multi-protocol templates #5426

Merged
merged 10 commits into from
Aug 1, 2024

Conversation

mhmdiaa
Copy link
Contributor

@mhmdiaa mhmdiaa commented Jul 21, 2024

Proposed changes

The multi-protocol execution engine does not apply input transformation as the generic engine does. This PR adds the transformation step to the multi-protocol engine to resolve #5425 and similar inconsistencies.

I have also removed the ad hoc transformers that were partially addressing the issue in the DNS and SSL engines. Let me know if you think this is the correct approach, as this causes two of the current tests to fail due to the transformation being handled at the outer layer.

Test template

id: test-multi-request-input-handling

info:
  name: Test Single Protocol Input Handling
  author: mhmdiaa
  severity: info

dns:
  - name: "{{FQDN}}"
    type: A
  - name: "{{FQDN}}"
    type: A

Before

nuclei -debug -u example.com:443 -t test-multi-request-input-handling.yaml
...
;; QUESTION SECTION:
;example.com:443.	IN	 A
...
;; opcode: QUERY, status: NXDOMAIN, id: 25391
...
;; QUESTION SECTION:
;example.com:443.	IN	 A
...
;; opcode: QUERY, status: NXDOMAIN, id: 22694

After

nuclei -debug -u example.com:443 -t test-multi-request-input-handling.yaml
...
;; QUESTION SECTION:
;example.com.	IN	 A
...
;; opcode: QUERY, status: NOERROR, id: 27821
...
;; ANSWER SECTION:
example.com.	92	IN	A	93.184.215.14
...
;; QUESTION SECTION:
;example.com.	IN	 A
...
;; opcode: QUERY, status: NOERROR, id: 28024
...
...
;; ANSWER SECTION:
example.com.	283	IN	A	93.184.215.14

Checklist

  • Pull request is created against the dev branch
  • All checks passed (lint, unit/integration/regression tests etc.) with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@ehsandeep ehsandeep requested a review from tarunKoyalwar July 21, 2024 15:46
Copy link
Member

@tarunKoyalwar tarunKoyalwar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm !

tests are flaky works fine locally

@tarunKoyalwar
Copy link
Member

@mhmdiaa thanks for contributing , i updated the tests and some other outdated code and added this in flow templates as well , nice catch !

You can grab some cool PD stickers over here http://nux.gg/stickers 😄

@tarunKoyalwar tarunKoyalwar requested a review from ehsandeep July 25, 2024 13:44
@ehsandeep ehsandeep merged commit ff23949 into projectdiscovery:dev Aug 1, 2024
9 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Templates with multiple DNS requests fail when the input is in "host:port" format
3 participants